<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>四色框</title>
    <link rel="stylesheet " href="css_3.css ">
    <style>
        .box1{
            width: 200px;
            height: 200px;
            background-color: #ccc;
        }
        .div{
            width:100px;
            height:100px;
        }
        .box1 .div:nth-child(2),.box1 .div:last-child{
            position: absolute;
            top: 0;
            left:100px;
        }
        .box1 .div:last-child{
            top: 100px;
        }
        .box1 .div:first-child{background-color: blue;}
        .box1 .div:nth-child(2){background-color:red; }
        .box1 .div:nth-child(3){background-color: aqua;}
        .box1 .div:last-child{background-color: blueviolet;}
    </style>
</head>
<body>
<div class="box1 ">
<div class="div">1</div>
<div class="div">2</div>
<div class="div">3</div>
<div class="div">4</div>
</div>

</body>
</html>